<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <script>
      // console.time("传统方式");
      // for (let i = 0; i < 10000; i++) {
      //   document.querySelector("#app").innerHTML = i;
      // }
      // console.timeEnd("传统方式");

      console.time("虚拟DOM方式");
      let j = 0;
      for (let i = 0; i < 10000; i++) {
        j = i;
      }
      document.querySelector("#app").innerHTML = j;
      console.timeEnd("虚拟DOM方式");
    </script>
  </body>
</html>
